package world.xuewei.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class MedicineDoc {

    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 药物名字
     */
    private String medicineName;

    /**
     * 关键字搜索
     */
    private String keyword;

    /**
     * 药物的功效
     */
    private String medicineEffect;

    /**
     * 药物的品牌
     */
    private String medicineBrand;

    /**
     * 药物的相互作用
     */
    private String interaction;

    /**
     * 禁忌
     */
    private String taboo;

    /**
     * 用法用量
     */
    private String usAge;

    /**
     * 药物的类型，0代表西药，1中药，2中成药
     */
    private Integer medicineType;

    /**
     * 药物的图片地址
     */
    private String imgPath;

    /**
     * 药物的价格
     */
    private BigDecimal medicinePrice;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 高亮文本
     */
    private String highlightedText;

    public MedicineDoc(Medicine medicine) {
        this.id = medicine.getId();
        this.medicineName = medicine.getMedicineName();
        this.keyword = medicine.getKeyword();
        this.medicineEffect = medicine.getMedicineEffect();
        this.medicineBrand = medicine.getMedicineBrand();
        this.interaction = medicine.getInteraction();
        this.taboo = medicine.getTaboo();
        this.usAge = medicine.getUsAge();
        this.medicineType = medicine.getMedicineType();
        this.imgPath = medicine.getImgPath();
        this.medicinePrice = medicine.getMedicinePrice();
        this.createTime = medicine.getCreateTime();
        this.updateTime = medicine.getUpdateTime();
    }
}
